package st.shadow.library.ui.dialog;

import android.app.Dialog;
import android.content.Context;

/**
 * @author zhangyu
 * @date 2018/3/8
 */

public class DialogLoader implements IDialog {

    private IDialog mDialog;

    public DialogLoader(Context context) {
        mDialog = new SweetDialog(context);
    }

    @Override
    public void showProgressDialog(boolean canCancel,String title, String msg) {
        mDialog.showProgressDialog(canCancel,title, msg);
    }

    @Override
    public void showProgressDialogWithCancel(String title, String msg, IDialogClickListener clickListener) {
        mDialog.showProgressDialogWithCancel(title, msg,clickListener);
    }

    @Override
    public void changeText(String title,String msg) {
        mDialog.changeText(title,msg);
    }

    @Override
    public void setConfirmText(String content) {
        mDialog.setConfirmText(content);
    }

    @Override
    public void setCancelText(String content) {
        mDialog.setCancelText(content);
    }

    @Override
    public void showCancel(boolean isShow) {
        mDialog.showCancel(isShow);
    }

    @Override
    public void showSuccess(String title,String msg,IDialogClickListener clickListener) {
        mDialog.showSuccess(title,msg, clickListener);
    }

    @Override
    public void showFailed(String title,String msg, IDialogClickListener clickListener) {
        mDialog.showFailed(title,msg, clickListener);
    }

    @Override
    public void showWarning(String title, String msg, IDialogClickListener clickListener) {
        mDialog.showWarning(title,msg,clickListener);
    }

    @Override
    public void showWarning(String title, String msg, IDialogClickListener clickListener, IDialogClickListener cancelListener) {
        mDialog.showWarning(title,msg,clickListener,cancelListener);
    }

    @Override
    public void clearDialog() {
        mDialog.clearDialog();
    }

    @Override
    public void stopProgressWithSuccess(String option, String msg, final IDialogClickListener listener) {
        mDialog.stopProgressWithSuccess(option,msg,listener);
    }

    @Override
    public void changeToProgressType(String msg) {
        mDialog.changeToProgressType(msg);
    }

    @Override
    public void stopProgressWithFailed(String option, String msg) {
        mDialog.stopProgressWithFailed(option,msg);
    }

    @Override
    public void stopProgressWithFailed(String option, String msg, IDialogClickListener listener) {
        mDialog.stopProgressWithFailed(option,msg,listener);
    }

    @Override
    public Dialog getDialog() {
        return mDialog.getDialog();
    }
}
